package com.gzx.bi.modular.plan.controller;

import com.gzx.bi.modular.plan.bo.GzxProjectPlanAddOrEditBo;
import com.gzx.bi.modular.plan.bo.GzxProjectPlanQueryBo;
import com.gzx.bi.modular.plan.service.GzxProjectPlanService;
import com.gzx.bi.modular.plan.vo.GzxProjectPlanVo;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import vip.xiaonuo.common.mvc.controller.BaseController;
import vip.xiaonuo.common.pojo.CommonResult;

import java.util.List;

/**
 * @author zjt
 * @description
 * @date 2025/4/27 16:28
 */
@RestController
@RequestMapping("/bi/project/plan")
public class GzxProjectPlanController extends BaseController<GzxProjectPlanAddOrEditBo, GzxProjectPlanVo, GzxProjectPlanQueryBo, GzxProjectPlanService> {
    public GzxProjectPlanController(GzxProjectPlanService baseService) {
        super(baseService);
    }


    /**
     * 查询当月项目计划
     *
     * @param belongingMonth 查询条件
     * @return
     */
    @GetMapping("/list/{belongingMonth}")
    public CommonResult<List<GzxProjectPlanVo>> list(@PathVariable("belongingMonth") Integer belongingMonth) {
        return CommonResult.data(baseService.list(belongingMonth));
    }

    /**
     * 初始化本月还款数据
     */
    @GetMapping("/initialize")
    public CommonResult<Void> initialize() {
        baseService.initialize();
        return CommonResult.ok();
    }
}
